Skip to content

Conversation

rozza
Copy link
Member

@rozza rozza commented Aug 14, 2025

No description provided.

Added support for schema 1.23

JAVA-5792
@rozza rozza changed the title Java 5674 CSFLE auto encryption tests improvements Aug 14, 2025
- Added scala UnifiedTest support.
- Added scala unified tests for ClientEncryption and Crud

JAVA-5674
@rozza rozza marked this pull request as ready for review August 18, 2025 10:47
@rozza rozza requested a review from a team as a code owner August 18, 2025 10:47
@rozza rozza requested review from nhachicha and vbabanin and removed request for a team and nhachicha August 18, 2025 10:47
@rozza rozza requested a review from katcharov August 27, 2025 10:14
Copy link
Member

@vbabanin vbabanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall! Just couple of nits and questions

Comment on lines 1367 to 1368
String collectionName = arguments.getString("collection").getValue();

Copy link
Member

@vbabanin vbabanin Aug 27, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] We could simplify this with:

String collectionName = arguments.remove("collection").asString().getValue();

Since we already follow the practice of removing consumed parameters/options, this keeps the approach consistent. For example, see UnifiedCrudHelper.java#L1806. The parsing is scoped to a single method (BsonDocument per operation), so we don’t risk cross-contamination. This also removes the need for the case "collection": break.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@@ -188,7 +188,7 @@ case class SyncMongoDatabase(wrapped: MongoDatabase) extends JMongoDatabase {
viewOn: String,
pipeline: java.util.List[_ <: Bson]
): Unit = {
throw new UnsupportedOperationException
wrapped.createView(unwrap(clientSession), viewName, viewOn, pipeline.asScala.toList).toFuture().get()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] Could we match the formatting used below for consistency, unless this is from Spotless auto-formatting?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes thats a Spotless automatic change - occurs once the line reaches a certain limit.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Given that the legacy CSFLE tests under the /legacy folder in the specification repository have been converted to the unified format under the /unified tests folder in this PR, do we still need AbstractClientSideEncryptionTest that runs the legacy tests? Or are there still some tests that haven’t yet been converted to the unified format?

By a quick check, looks like all file names in legacy folder are present in unified folder.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will be removed as the final part of JAVA-5674 once the tests are merged in the specs repo. Added JAVA-5953 to track.

@@ -110,7 +110,7 @@ public abstract class UnifiedTest {
private static final Set<String> PRESTART_POOL_ASYNC_WORK_MANAGER_FILE_DESCRIPTIONS = Collections.singleton(
"wait queue timeout errors include details about checked out connections");

private static final String MAX_SUPPORTED_SCHEMA_VERSION = "1.22";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see that schemaVersion has been increased to 1.25 in the unified encryption tests. Should we also bump it to 1.25?

Copy link
Member Author

@rozza rozza Aug 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, that work is coming in the next PR (JAVA-5851)

rozza and others added 2 commits August 28, 2025 09:02
…fiedClientEncryptionHelper.java

Co-authored-by: Viacheslav Babanin <[email protected]>
@rozza rozza requested a review from vbabanin August 28, 2025 08:14
Copy link
Member

@vbabanin vbabanin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants